As noise is contained in spectrum data that is inputted (input spectrum data), processing for removing the noise contained in the input spectrum data before outputting has been executed in the past.
For example, with an optical spectrum analyzer, white noise contained in input spectrum data is removed through moving average processing before outputting (refer to Patent Document 1). According to the moving average processing, a plurality of input spectrum data acquired in time sequence are averaged, and noise components having large variation in value can cancel out each other, thereby enabling noise-removed spectrum data to be obtained.
With the conventional moving average processing, however, moving average processing is applied to all measurement data-blocks making up the input spectrum data. For this reason, even in the case of input spectrum data having a steep spectral peak, a spectral shape thereof is rounded owing to the integration effect of moving average processing that is applied in the vicinity of the steep spectral peak.
In contrast to the above, there is available a method whereby a user selects only a measurement data-block with noise superimposed thereon, and applies moving-average processing to only the measurement data-block as selected, in a localized manner, thereby preventing occurrence of rounding in spectral shape, however, in this case, human judgment will have to interfere with determination on whether or not noise is superimposed thereon, so that it is impossible to automate noise removal.
Accordingly, there have also been proposed a method for automatically removing noise out of input spectrum data while suppressing rounding in spectral shape, and a system for carrying out the method (refer to Patent Document 2).
FIG. 7 is a block diagram broadly showing a configuration of an optical spectrum analyzer 100 described in Patent Document 2. The optical spectrum analyzer 100 is mainly for use in analyzing wavelengths of a laser beam outgoing from a laser oscillator, the optical spectrum analyzer 100 being comprised of a spectroscope 1, a photo-detector 2, an amplifier 3, an A/D converter (analog/digital converter) 4, a memory 5, an operating panel 6, a CPU 7, and a display unit 8.
The spectroscope 1 converts light under test, such as, for example, a laser beam falling thereon via an optical fiber, into a dispersion spectrum to thereby extract light components contained in the light under test, having desired wavelengths, before outputting the same.
The photo-detector 2 is disposed such that a light-receiving surface thereof is opposed to the spectroscope 1 to receive light outgoing from the spectroscope 1, thereby converting the light into an electric signal to be subsequently outputted. For the photo-detector 2, use can be made of, for example, a photodiode.
The amplifier 3 is for use in amplifying the electric signal outputted from the photo-detector 2 before outputting.
The A/D converter 4 is for use in converting the electric signal (analog signal) amplified by the amplifier 3 into a digital signal, and outputting the digital signal as a measurement data-block to a buss B connected to the CPU 7.
The memory 5 is for provisionally storing various parameters besides pre-storing a control program, a signal processing program, and so forth, to be run by the CPU 7, the memory 5 being electrically connected to the CPU 7 via the buss B. The memory 5 is made up of a hard disc, a RAM (Random Access Memory), a ROM (Read Only Memory), and so forth, so as to carry out input/output of various information under instructions from the CPU 7.
The operating panel 6 is provided with various operation buttons such as function keys, ten keys, and so forth, outputting operational instructions from a user, the operating panel 6 being electrically connected to the CPU 7 via the buss B.
The CPU 7 is electrically connected to the A/D converter 4, the memory 5, the operating panel 6, and the display unit 8 via the buss B, controlling each of those units according to the control program while applying predetermined processing (a spectrum data correction method) to the measurement data-block according to the signal processing program to thereby acquire spectrum data to be displayed on the display unit 8.
The display unit 8 is for visualizing the spectrum data to be subsequently outputted, the display unit 8 being electrically connected to the CPU 7 via the buss B. The display unit 8 is made up of, for example, aN LCD (Liquid Crystal Display), or a CRT (Cathode Ray Tube).
The optical spectrum analyzer 100 acquires the spectrum data on the basis of the measurement data-blocks by the action of the CPU 7, and in this case, a spectrum data correction process (the spectrum data correction method) is executed as part of the signal-processing program according to a block diagram shown in FIG. 8.
FIG. 8 is the block diagram showing a functional configuration for execution of the spectrum data correction process by the optical spectrum analyzer 100. As shown in FIG. 8, the optical spectrum analyzer 100 is provided with a flag-addition unit 10, a selection unit 20, an execution unit 30, and an outputting unit 40 in order to execute the spectrum data correction process. In this connection, those units, namely, the flag-addition unit 10, the selection unit 20, the execution unit 30, and the outputting unit 40 are embodied by the respective actions of the memory 5, and the CPU 7.
The flag-addition unit 10 is for comparing adjacent measurement data-blocks, along a wavelength axis (a frequency axis), among the measurement data-blocks making up the input spectrum data, with each other, thereby adding a “mountain-valley flag” indicating a relationship in magnitude between the measurement data-blocks as compared to each of the measurement data-blocks as compared. Further, the flag-addition unit 10 outputs an input spectrum data-block with a flag added thereto as a flag-added spectrum data-block. Further, the input spectrum data is spectrum data that is obtained on the basis of a value of the measurement data-block inputted to the CPU 7, representing a function for expressing a value (an optical output) of the measurement data-block, per unit time, and a wavelength thereof.
More specifically, the flag-addition unit 10 compares the adjacent measurement data-blocks with each other, adding a flag “1” (valley flag) to the measurement data-block on a short-wavelength side thereof if the measurement data-block on a long-wavelength side thereof is smaller in value than the measurement data-block on the short-wavelength side, while adding a flag “0” (mountain flag) to the measurement data-block on the short-wavelength side if the measurement data-block on the long-wavelength side is equal to, or greater in value than the measurement data-block on the short-wavelength side.
Thus, in the case where the measurement data-block on the short wavelength side decreases in value, as seen from the measurement data-block on the long-wavelength side, the flag-addition unit 10 adds a flag different from a flag that is added in the case where the measurement data-block on the short-wavelength side remains unchanged, or increases in value, as seen from the measurement data-block on the long-wavelength side. Further, for convenience's sake, a flag “0” is added to a measurement data-block, on the longest wavelength side of the input spectrum data, among the measurement data-blocks making up the input spectrum data, because an object of comparison necessary for execution of flag-addition does not exist in this case.
The selection unit 20 selects a measurement data-block to which the moving average processing is to be applied, among the measurement data-blocks making up the input spectrum data, on the basis of the flag-added spectrum data-block (that is, the flag as added). Then, the selection unit 20 separately outputs a selected measurement data-block that is a measurement data-block as selected for application of the moving average processing, and an unselected measurement data-block that is a measurement data-block not selected (a measurement data-block to which the moving average processing is not to be applied).
More specifically, the selection unit 20 first compares adjacent flags with each other at the outset, and if the flags differ in marking from each other, the selection unit 20 substitutes a mean value of measurement data-blocks with respective pertinent flags added thereto for those measurement data-blocks, while if the same flag successively occurs, the selection unit 20 leave out the measurement data-blocks with the pertinent flags added thereto, respectively, as they are, thereby generating spectrum data for discriminating noise superimposition. Further, an operation for substituting the mean value of the measurement data-blocks with respective pertinent flags added thereto for those measurement data-blocks may be repeated a predetermined number of times.
Subsequently, the selection unit 20 compares the spectrum data for discriminating the noise superimposition with the input spectrum data, outputting the measurement data-block of the input spectrum data, differing in value from the measurement data-block of the spectrum data for discriminating the noise superimposition, as the selected measurement data-block, while outputting the measurement data-block of the input spectrum data, equal in value to the measurement data-block of the spectrum data for discriminating the noise superimposition, as the unselected measurement data-block.
In other words, if the adjacent flags differ in marking from each other, the selection unit 20 substitutes a mean value obtained by averaging values of the measurement data-blocks with the respective flags added thereto for the measurement data-blocks with the respective flags added thereto, to be determined as the measurement data-block of the spectrum data for discriminating the noise superimposition, thereby creating a difference from the original measurement data-block. Further, the selection unit 20 determines the measurement data-block of the input spectrum data, differing in value from the measurement data-block of the spectrum data for discriminating the noise superimposition, as the selected measurement data-block. That is, a measurement data-block having a flag different in marking from a flag added to an adjacent measurement data-block is determined as the selected measurement data-block.
FIG. 9 is a waveform chart of input spectrum data, showing the input spectrum data of a laser beam outgoing from a laser oscillator. The input spectrum data shown in FIG. 9 has a steep spectral peak P, and white noise is superimposed thereon. And since the input spectrum data of the laser beam from the laser oscillator has the steep spectral peak P, a rate of change in optical output is large in regions high in optical output, in the vicinity of the steep spectral peak P, and an effect of white noise is smaller in the regions, while the effect of white noise is larger in regions low in optical output, away from the steep spectral peak P.
If the flag-addition unit 10 adds a flag to the measurement data-blocks, respectively, against the input spectrum data, as described above, the effect of the white noise will be small in the regions high in optical output, in the vicinity of the steep spectral peak P, and a rate of change in optical output is large in each of the measurement data-blocks adjacent to each other, so that the same flag successively occurs thereto. Further, the effect of the white noise will be large in the regions low in optical output, away from the steep spectral peak P, and increase/decrease in value of the measurement data-block will occur at random, so that the flag will undergo frequent change in marking.
Further, if the adjacent flags differ in marking from each other, the selection unit 20 determines that the measurement data-blocks with the relevant flags added thereto, respectively, are the selected measurement data-block. Accordingly, the measurement data-block in the region where the effect of the white noise is large is determined as the selected measurement data-block, and the measurement data-block in the region where the effect of the white noise is small is determined as the unselected measurement data-block.
Further, since a direction of change in optical output of the respective measurement data-blocks is reversed at the steep spectral peak P, the flags differing in marking from each other are added to the respective measurement data-blocks. In consequence, if all the measurement data-blocks are each determined as the selected measurement data-block in the case of the flags differing in marking from each other, the measurement data-block at the steep spectral peak P, as well, will be determined as the selected measurement data-block to be later subjected to the moving average processing.
If input spectrum data has a steep spectral peak, in particular, the measurement data-block at the steep spectral peak P is preferably not to be subjected to the moving average processing in order to reduce deterioration in resolution and dynamic range. Accordingly, the selection unit 20 extracts the measurement data-block at the steep spectral peak P (a measurement data-block indicating the apex of input spectrum data) as the measurement data-block at the singular point, thereby determining that the measurement data-block at the singular point be not selected as the selected measurement data-block. In other words, the selection unit 20 determines the measurement data-block at the singular point as the unselected measurement data-block.
More specifically, the selection unit 20, upon comparing the adjacent flags with each other, determines that a measurement data-block at a transition point between a flag-succession region where a predetermined number of flags “1” successively occur, and a flag-succession region where a predetermined number of flags “0” successively occur is the measurement data-block at the singular point, and a value of the measurement data-block at the singular point is kept static irrespective of flag marking. By so doing, when the spectrum data for discriminating the noise superimposition is compared with the input spectrum data, the measurement data-block at the singular point will indicate the same value at both the spectrum data for discriminating the noise superimposition, and the input spectrum data, so that the measurement data-block at the singular point is determined as the unselected measurement data-block.
Further, the number of the flags, required for defining the flag-succession region, is set to the maximum number of the same flags that are estimated to successively occur in the region where the effect of the white noise is large, plus a margin for error. By so doing, the measurement data-block at the singular point can be extracted with certainty.
Further, in the case of the measurement data-blocks in the flag-succession region as well as the measurement data-block at the singular point, the effect of the white noise thereon is small, and there is therefore no need for applying the moving average processing thereto. Accordingly, with the optical spectrum analyzer 100 according to the present embodiment, the selection unit 20 determines the measurement data-blocks in the flag-succession region as the unselected measurement data-blocks as is the case with the measurement data-block at the singular point.
Now, reverting to FIG. 8, the execution unit 30 is for applying the moving average processing to the selected measurement data-block that is selected by the selection unit 20. More specifically, the execution unit 30 applies the moving average processing to the selected measurement data-block, in accordance with the following expression (1), thereby outputting a moving-average-processed measurement data-block that has been subjected to the moving average processing.
In the expression (1), g(i) indicates a value of an i-th measurement data-block of noise-removed spectrum data (spectrum data from which the last white noise is removed), f(i) a value of an i-th measurement data-block of the input spectrum data, and m a predetermined count of moving-average points, forward, and backward. Further, i of g(i) is in a range of from m+1 to n (the total number of measurement data-blocks making up the input spectrum data)−m.
Then, the execution unit 30 works out a measurement data-block in the noise-removed spectrum data, the measurement data-block being the data-block out of which the white noise has been removed according to the moving average processing:
                              g          ⁡                      (            i            )                          =                              1                                          2                ⁢                                                                  ⁢                m                            +              1                                ⁢                                    ∑                              i                -                m                                            i                +                m                                      ⁢                                                  ⁢                          f              ⁡                              (                i                )                                                                        (        1        )            
The outputting unit 40 merges the measurement data-blocks that have undergone the moving-average processing, outputted from the execution unit 30, with the unselected measurement data-blocks outputted from the selection unit 20, thereby completing noise-removed spectrum data to be subsequently outputted.
The unselected measurement data-block outputted from the selection unit 20 is represented by expression (2) after the expression (1):g(i)=f(i)  (2)
FIG. 10 is a waveform chart showing the noise-removed spectrum data generated from the input spectrum data shown in FIG. 9. As is evident by comparing FIG. 10 with FIG. 9, with the noise-removed spectrum data generated by the optical spectrum analyzer 100, rounding in regions in the vicinity of the steep spectral peak P of the input spectrum data is prevented, and white noise is found removed.
Next, a spectrum data correction process (a spectrum data correction method) executed by the optical spectrum analyzer 100 made up as above is described with reference to a flow chart of FIG. 11.
When the spectrum data correction process is started, and input spectrum data f(i) is inputted (step S1), the flag-addition unit 10 compares adjacent measurement data-blocks, along the wavelength axis, among the measurement data-blocks making up the input spectrum data f(i), with each other, thereby adding a flag to the respective measurement data-blocks as compared, the flag indicating a relationship in magnitude between the respective measurement data-blocks (step S2).
At this point in time, the flag-addition unit 10 adds the flag “1” to a measurement data-block on the short-wavelength side if a measurement data-block on the long-wavelength side is smaller in value than the measurement data-block on the short-wavelength side, while adding the flag “0” to the measurement data-block on the short-wavelength side if the measurement data-block on the long-wavelength side is equal to, or larger in value than the measurement data-block on the short-wavelength side. Further, the flag-addition unit 10 outputs the input spectrum data with flags added thereto as flag-added spectrum data.
When the flags are added to the input spectrum data-block f(i) by the flag-addition unit 10, as described above, to be outputted as the flag-added spectrum data-block, the selection unit 20 compares the adjacent flags with each other, thereby extracting the measurement data-block at the singular point, contained in the input spectrum data f(i), and the measurement data-blocks in the flag-succession region (step S3), whereupon respective values of those measurement data-blocks as extracted are kept static.
Then, the selection unit 20 compares the adjacent flags with each other, executing a process (process for acquiring a mean value) whereby if the flags differ in marking from each other, the mean value of the measurement data-blocks with the pertinent flags added thereto, respectively, is substituted for those measurement data-blocks, while if the same flag successively occurs, the measurement data-blocks with the pertinent flags added thereto, respectively, are left out as they are, thereby generating spectrum data f′ (i) for discriminating the noise superimposition.
More specifically, the selection unit 20 determines whether or not a count K of times that a process for finding the mean value of the measurement data-blocks is executed has reached a predetermined loop count (step S4), and if not, the selection unit 20 repeats the process until the count K of the times will reach the predetermined loop count (step S5). As a result, the spectrum data f′ (i) for discriminating the noise superimposition is generated.
Subsequently, the selection unit 20 compares the input spectrum data f(i) with the spectrum data f′ (i) for discriminating the noise superimposition (step S6), and if a measurement data-block at the input spectrum data f(i) is identical in value to a measurement data-block at the spectrum data f′ (i) for discriminating the noise superimposition {that is, measurement data-blocks if f(i)−f′ (i)=0}, the selection unit 20 determines those measurement data-blocks as unselected measurement data-blocks to be outputted as the measurement data-block of the noise-removed spectrum data g(i).
Then, the selection unit 20 determines a measurement data-block at the input spectrum data f(i), differing in value from a measurement data-block at the spectrum data f′ (i) for discriminating the noise superimposition (that is, the measurement data-block of the input spectrum data, having a difference in value from the measurement data-block of the spectrum data for discriminating the noise superimposition), as the selected measurement data-block to be subsequently outputted.
Since the measurement data-block at the singular point, and the measurement data-blocks in the flag-succession region have already been extracted to be rendered static in value in the step S3, those measurement data-blocks are determined as the unselected measurement data-blocks in the step S6 to be then outputted without being subjected to the moving-average processing.
When the selected measurement data-block is outputted from the selection unit 20, the execution unit 30 applies the moving-average processing to the selected measurement data-block (step S7), thereby determining the measurement data-block with the moving average processing applied thereto (the moving-average processed measurement data-block) as the measurement data-block of the noise-removed spectrum data g(i) to be subsequently outputted.
Thus, when the unselected measurement data-block is outputted from the selection unit 20 as the measurement data-block of the noise-removed spectrum data g(i), and the execution unit 30 outputs the measurement data-block with the moving-average processing applied thereto as the measurement data-block of the noise-removed spectrum data g(i), the outputting unit 40 merges those measurement data-blocks with each other to thereby generate the noise-removed spectrum data g(i) to be subsequently outputted (step S8).
With the noise-removed spectrum data g(i) generated by the spectrum data correction process described as above, occurrence of rounding in the regions in the vicinity of the steep spectral peak P is prevented, and the white noise is found removed as shown in FIG. 10.
FIG. 12 is a flow chart for describing another spectrum data correction process executed by the optical spectrum analyzer 100. In step S6 of FIG. 12, the selection unit 20 works out the absolute value of a difference in value between a measurement data-block at the input spectrum data f(i) and a measurement data-block at the spectrum data f′ (i) for discriminating the noise superimposition. Further, since the spectrum data f′ (i) for discriminating the noise superimposition represents a mean value of respective values of measurement data-blocks, relationship therebetween being compared in respect of magnitude, the absolute value indicates a difference between the value of the measurement data-block of the input spectrum data f(i), and the mean value of the respective values of the measurement data-blocks, the relationship therebetween being compared in respect of magnitude.
Then, if the absolute value is 0, the selection unit 20 outputs the measurement data-blocks as the unselected measurement data-blocks. If the absolute value is not 0, the selection unit 20 outputs the measurement data-blocks as the selected measurement data-blocks, together with the absolute value.
When the selected measurement data-blocks, together with the absolute value, are outputted, the execution unit 30 undertakes to apply the moving average processing to the relevant selected measurement data-blocks, thereby varying the count m of the moving-average points, shown in the expression (1), according to the absolute value. More specifically, if the absolute value is relatively large in value, the execution unit 30 will increase the count of the moving-average points, decreasing the count of the moving-average points if the absolute value is relatively small in value.
The absolute value is proportional to a white noise quantity. For this reason, white noise can be effectively removed out of the input spectrum data f(i). Further, the moving-average processing large in the count of the moving-average points is applied to a measurement data-block large in a white-noise superimposition quantity, and white noise can be removed with greater certainty, so that continuity between the measurement data-block to which the moving-average processing has been applied, and the measurement data-block to which the moving-average processing has not been applied can be enhanced, thereby improving continuity in the noise-removed spectrum data g(i).
With the optical spectrum analyzer 100 made up as above, adjacent measurement data-blocks, along the wavelength axis, are compared with each other, and a flag indicating a relationship in magnitude between the measurement data-blocks is added thereto. Further, the measurement data-block to which the moving-average processing is to be applied is selected on the basis of a relevant flag, and the moving-average processing is applied only to the measurement data-block as selected.
In other words, on the basis of the flag indicating the relationship in magnitude between the measurement data-blocks adjacent to each other, the measurement data-block with noise superimposed thereon (where the effect of noise is large) is automatically selected, and the moving-average processing is applied only to this selected measurement data-block.
Accordingly, noise can be automatically removed out of the input spectrum data while rounding in spectral shape is being suppressed.
Further, there is adopted a configuration wherein the measurement data-block indicating the apex of the input spectrum data is extracted as the measurement data-block at the singular point before selecting the measurement data-block to which the moving-average processing is to be applied, and the measurement data-block at the singular point as extracted is not selected as the measurement data-block to which the moving-average processing is to be applied.
By so doing, the measurement data-block at the singular point can be prevented from being subjected to the moving-average processing, thereby checking deterioration in resolution and dynamic range.